package com.note.simpleshop.module.system.controller;

import com.note.simpleshop.constant.ErrorCode;
import com.note.simpleshop.entity.TbBanner;
import com.note.simpleshop.module.system.service.BannerService;
import com.note.simpleshop.vo.Msg;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("system/banner")
public class BannerController {
    private static final Logger logger = LoggerFactory.getLogger(BannerController.class);
    @Autowired
    private BannerService bannerService;
    @ApiOperation(value = "list", notes = "获取首页banner")
    @PostMapping(value = "list")
    public Msg list() {
        logger.info("*************lis111111t***********");
        logger.error("*************listeerr***********");
        Msg msg=new Msg();
        msg.setErrorCode(ErrorCode.ERROR_0000);
        List<TbBanner> list=bannerService.findByShow(TbBanner.IS_SHOW1);
        msg.setData(list);
        return msg;
    }
}
